using RxjhServer.DbClss;
using System;
using System.Collections.Generic;
using System.Data;
using System.Threading;
using System.Timers;

namespace RxjhServer
{
	public class 科举系统 : IDisposable
	{
		private DateTime dateTime_0;

		private static List<int> list_0;

		private string[] string_0;

		private System.Timers.Timer timer_0;

		private System.Timers.Timer timer_1;

		private System.Timers.Timer timer_2;

		static 科举系统()
		{
			smethod_0();
		}

		public 科举系统()
		{
			string_0 = World.科举配置.Split(';');
			list_0.Clear();
			dateTime_0 = DateTime.Now.AddMinutes(World.科举倒计时间1);
			timer_0 = new System.Timers.Timer(World.科举公告间隔时间);
			timer_0.Elapsed += 发送科举开始时间公告;
			timer_0.Enabled = true;
			timer_0.AutoReset = true;
			发送科举开始时间公告(null, null);
			timer_1 = new System.Timers.Timer(World.科举倒计时间2);
			timer_1.Elapsed += 科举开始;
			timer_1.Enabled = true;
		}

		public void Dispose()
		{
			list_0.Clear();
			if (timer_0 != null)
			{
				timer_0.Enabled = false;
				timer_0.Close();
				timer_0.Dispose();
			}
			if (timer_1 != null)
			{
				timer_1.Enabled = false;
				timer_1.Close();
				timer_1.Dispose();
			}
			if (timer_2 != null)
			{
				timer_2.Enabled = false;
				timer_2.Close();
				timer_2.Dispose();
			}
			World.科举 = null;
		}

		public void function(object ojb)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			if (World.科举考试奖励类型 == 0)
			{
				try
				{
					Players players = ojb as Players;
					List<科举系统类> list = new List<科举系统类>();
					foreach (科举系统类 value in World.科举出题.Values)
					{
						list.Add(value);
					}
					for (int i = 0; i < list.Count; i++)
					{
						players.系统提示("第" + list[i].序号.ToString() + "题是：" + list[i].标题, 10, World.科举提示设置);
						players.系统提示(list[i].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list[i].正确答案 == players.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.保存人物的数据();
								players.保存人物数据存储过程();
								players.系统提示("恭喜你答对了。奖励你" + list[i].元宝.ToString() + " 个元宝。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players.得分统计 += list[i].元宝;
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.系统提示("恭喜你答对了。此题" + list[i].元宝.ToString() + "个元宝", 20, "系统提示");
								players.保存人物的数据();
								players.保存人物数据存储过程();
							}
						}
						else if (players.答案选择 == "0")
						{
							players.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players.系统提示("很遗憾，你答错了。本题正确答案是[" + list[i].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "GameServer");
						int num = (int)dBToDataTable.Rows[0]["得分统计"];
						if (dBToDataTable.Rows.Count >= 1 && players.得分统计 != 0)
						{
							players.检察元宝数据(World.科举奖励第一名奖元宝, 2);
							players.保存元宝数据();
							players.保存人物的数据();
							players.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖元宝.ToString() + "个元宝", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players.UserName + "】，得分：" + num.ToString() + "分", 10, "系统提示");
						}
					}
					players.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 1)
			{
				try
				{
					Players players2 = ojb as Players;
					List<科举系统类> list2 = new List<科举系统类>();
					foreach (科举系统类 value2 in World.科举出题.Values)
					{
						list2.Add(value2);
					}
					for (int j = 0; j < list2.Count; j++)
					{
						players2.系统提示("第" + list2[j].序号.ToString() + "题是：" + list2[j].标题, 10, World.科举提示设置);
						players2.系统提示(list2[j].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list2[j].正确答案 == players2.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
								players2.系统提示("恭喜你答对了。奖励你" + list2[j].积分.ToString() + " 个积分。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players2.得分统计 += list2[j].积分;
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.系统提示("恭喜你答对了。此题" + list2[j].积分.ToString() + "个积分", 20, "系统提示");
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
							}
						}
						else if (players2.答案选择 == "0")
						{
							players2.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players2.系统提示("很遗憾，你答错了。本题正确答案是[" + list2[j].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players2.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand2 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable2 = DBA.GetDBToDataTable(sqlCommand2, "GameServer");
						int num2 = (int)dBToDataTable2.Rows[0]["得分统计"];
						if (dBToDataTable2.Rows.Count >= 1 && players2.得分统计 != 0)
						{
							players2.检察积分数据(World.科举奖励第一名奖积分, 1);
							players2.保存积分数据();
							players2.保存人物的数据();
							players2.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖积分.ToString() + "个积分", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players2.UserName + "】，得分：" + num2.ToString() + "分", 10, "系统提示");
						}
					}
					players2.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 2)
			{
				try
				{
					Players players3 = ojb as Players;
					List<科举系统类> list3 = new List<科举系统类>();
					foreach (科举系统类 value3 in World.科举出题.Values)
					{
						list3.Add(value3);
					}
					for (int k = 0; k < list3.Count; k++)
					{
						players3.系统提示("第" + list3[k].序号.ToString() + "题是：" + list3[k].标题, 10, World.科举提示设置);
						players3.系统提示(list3[k].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list3[k].正确答案 == players3.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
								players3.系统提示("恭喜你答对了。奖励你" + list3[k].武勋.ToString() + " 个武勋。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players3.得分统计 += list3[k].武勋;
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.系统提示("恭喜你答对了。此题" + list3[k].武勋.ToString() + "个武勋", 20, "系统提示");
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
							}
						}
						else if (players3.答案选择 == "0")
						{
							players3.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players3.系统提示("很遗憾，你答错了。本题正确答案是[" + list3[k].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players3.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand3 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable3 = DBA.GetDBToDataTable(sqlCommand3, "GameServer");
						int num3 = (int)dBToDataTable3.Rows[0]["得分统计"];
						if (dBToDataTable3.Rows.Count >= 1 && players3.得分统计 != 0)
						{
							players3.Player_WuXun += World.科举奖励第一名奖武勋;
							players3.更新武勋效果();
							players3.保存人物的数据();
							players3.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖武勋.ToString() + "个武勋", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players3.UserName + "】，得分：" + num3.ToString() + "分", 10, "系统提示");
						}
					}
					players3.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
		}

		public void function2(object ojb)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			if (World.科举考试奖励类型 == 0)
			{
				try
				{
					Players players = ojb as Players;
					List<科举系统类2> list = new List<科举系统类2>();
					foreach (科举系统类2 value in World.科举出题2.Values)
					{
						list.Add(value);
					}
					for (int i = 0; i < list.Count; i++)
					{
						players.系统提示("第" + list[i].序号.ToString() + "题是：" + list[i].标题, 10, World.科举提示设置);
						players.系统提示(list[i].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list[i].正确答案 == players.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.保存人物的数据();
								players.保存人物数据存储过程();
								players.系统提示("恭喜你答对了。奖励你" + list[i].元宝.ToString() + " 个元宝。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players.得分统计 += list[i].元宝;
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.系统提示("恭喜你答对了。此题" + list[i].元宝.ToString() + "个元宝", 20, "系统提示");
								players.保存人物的数据();
								players.保存人物数据存储过程();
							}
						}
						else if (players.答案选择 == "0")
						{
							players.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players.系统提示("很遗憾，你答错了。本题正确答案是[" + list[i].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "GameServer");
						int num = (int)dBToDataTable.Rows[0]["得分统计"];
						if (dBToDataTable.Rows.Count >= 1 && players.得分统计 != 0)
						{
							players.检察元宝数据(World.科举奖励第一名奖元宝, 2);
							players.保存元宝数据();
							players.保存人物的数据();
							players.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖元宝.ToString() + "个元宝", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players.UserName + "】，得分：" + num.ToString() + "分", 10, "系统提示");
						}
					}
					players.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 1)
			{
				try
				{
					Players players2 = ojb as Players;
					List<科举系统类2> list2 = new List<科举系统类2>();
					foreach (科举系统类2 value2 in World.科举出题2.Values)
					{
						list2.Add(value2);
					}
					for (int j = 0; j < list2.Count; j++)
					{
						players2.系统提示("第" + list2[j].序号.ToString() + "题是：" + list2[j].标题, 10, World.科举提示设置);
						players2.系统提示(list2[j].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list2[j].正确答案 == players2.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
								players2.系统提示("恭喜你答对了。奖励你" + list2[j].积分.ToString() + " 个积分。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players2.得分统计 += list2[j].积分;
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.系统提示("恭喜你答对了。此题" + list2[j].积分.ToString() + "个积分", 20, "系统提示");
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
							}
						}
						else if (players2.答案选择 == "0")
						{
							players2.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players2.系统提示("很遗憾，你答错了。本题正确答案是[" + list2[j].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players2.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand2 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable2 = DBA.GetDBToDataTable(sqlCommand2, "GameServer");
						int num2 = (int)dBToDataTable2.Rows[0]["得分统计"];
						if (dBToDataTable2.Rows.Count >= 1 && players2.得分统计 != 0)
						{
							players2.检察积分数据(World.科举奖励第一名奖积分, 1);
							players2.保存积分数据();
							players2.保存人物的数据();
							players2.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖积分.ToString() + "个积分", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players2.UserName + "】，得分：" + num2.ToString() + "分", 10, "系统提示");
						}
					}
					players2.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 2)
			{
				try
				{
					Players players3 = ojb as Players;
					List<科举系统类2> list3 = new List<科举系统类2>();
					foreach (科举系统类2 value3 in World.科举出题2.Values)
					{
						list3.Add(value3);
					}
					for (int k = 0; k < list3.Count; k++)
					{
						players3.系统提示("第" + list3[k].序号.ToString() + "题是：" + list3[k].标题, 10, World.科举提示设置);
						players3.系统提示(list3[k].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list3[k].正确答案 == players3.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
								players3.系统提示("恭喜你答对了。奖励你" + list3[k].武勋.ToString() + " 个武勋。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players3.得分统计 += list3[k].武勋;
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.系统提示("恭喜你答对了。此题" + list3[k].武勋.ToString() + "个武勋", 20, "系统提示");
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
							}
						}
						else if (players3.答案选择 == "0")
						{
							players3.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players3.系统提示("很遗憾，你答错了。本题正确答案是[" + list3[k].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players3.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand3 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable3 = DBA.GetDBToDataTable(sqlCommand3, "GameServer");
						int num3 = (int)dBToDataTable3.Rows[0]["得分统计"];
						if (dBToDataTable3.Rows.Count >= 1 && players3.得分统计 != 0)
						{
							players3.Player_WuXun += World.科举奖励第一名奖武勋;
							players3.更新武勋效果();
							players3.保存人物的数据();
							players3.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖武勋.ToString() + "个武勋", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players3.UserName + "】，得分：" + num3.ToString() + "分", 10, "系统提示");
						}
					}
					players3.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
		}

		public void function3(object ojb)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			if (World.科举考试奖励类型 == 0)
			{
				try
				{
					Players players = ojb as Players;
					List<科举系统类3> list = new List<科举系统类3>();
					foreach (科举系统类3 value in World.科举出题3.Values)
					{
						list.Add(value);
					}
					for (int i = 0; i < list.Count; i++)
					{
						players.系统提示("第" + list[i].序号.ToString() + "题是：" + list[i].标题, 10, World.科举提示设置);
						players.系统提示(list[i].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list[i].正确答案 == players.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.保存人物的数据();
								players.保存人物数据存储过程();
								players.系统提示("恭喜你答对了。奖励你" + list[i].元宝.ToString() + " 个元宝。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players.得分统计 += list[i].元宝;
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.系统提示("恭喜你答对了。此题" + list[i].元宝.ToString() + "个元宝", 20, "系统提示");
								players.保存人物的数据();
								players.保存人物数据存储过程();
							}
						}
						else if (players.答案选择 == "0")
						{
							players.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players.系统提示("很遗憾，你答错了。本题正确答案是[" + list[i].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "GameServer");
						int num = (int)dBToDataTable.Rows[0]["得分统计"];
						if (dBToDataTable.Rows.Count >= 1 && players.得分统计 != 0)
						{
							players.检察元宝数据(World.科举奖励第一名奖元宝, 2);
							players.保存元宝数据();
							players.保存人物的数据();
							players.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖元宝.ToString() + "个元宝", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players.UserName + "】，得分：" + num.ToString() + "分", 10, "系统提示");
						}
					}
					players.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 1)
			{
				try
				{
					Players players2 = ojb as Players;
					List<科举系统类3> list2 = new List<科举系统类3>();
					foreach (科举系统类3 value2 in World.科举出题3.Values)
					{
						list2.Add(value2);
					}
					for (int j = 0; j < list2.Count; j++)
					{
						players2.系统提示("第" + list2[j].序号.ToString() + "题是：" + list2[j].标题, 10, World.科举提示设置);
						players2.系统提示(list2[j].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list2[j].正确答案 == players2.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
								players2.系统提示("恭喜你答对了。奖励你" + list2[j].积分.ToString() + " 个积分。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players2.得分统计 += list2[j].积分;
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.系统提示("恭喜你答对了。此题" + list2[j].积分.ToString() + "个积分", 20, "系统提示");
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
							}
						}
						else if (players2.答案选择 == "0")
						{
							players2.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players2.系统提示("很遗憾，你答错了。本题正确答案是[" + list2[j].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players2.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand2 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable2 = DBA.GetDBToDataTable(sqlCommand2, "GameServer");
						int num2 = (int)dBToDataTable2.Rows[0]["得分统计"];
						if (dBToDataTable2.Rows.Count >= 1 && players2.得分统计 != 0)
						{
							players2.检察积分数据(World.科举奖励第一名奖积分, 1);
							players2.保存积分数据();
							players2.保存人物的数据();
							players2.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖积分.ToString() + "个积分", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players2.UserName + "】，得分：" + num2.ToString() + "分", 10, "系统提示");
						}
					}
					players2.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 2)
			{
				try
				{
					Players players3 = ojb as Players;
					List<科举系统类3> list3 = new List<科举系统类3>();
					foreach (科举系统类3 value3 in World.科举出题3.Values)
					{
						list3.Add(value3);
					}
					for (int k = 0; k < list3.Count; k++)
					{
						players3.系统提示("第" + list3[k].序号.ToString() + "题是：" + list3[k].标题, 10, World.科举提示设置);
						players3.系统提示(list3[k].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list3[k].正确答案 == players3.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
								players3.系统提示("恭喜你答对了。奖励你" + list3[k].武勋.ToString() + " 个武勋。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players3.得分统计 += list3[k].武勋;
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.系统提示("恭喜你答对了。此题" + list3[k].武勋.ToString() + "个武勋", 20, "系统提示");
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
							}
						}
						else if (players3.答案选择 == "0")
						{
							players3.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players3.系统提示("很遗憾，你答错了。本题正确答案是[" + list3[k].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players3.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand3 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable3 = DBA.GetDBToDataTable(sqlCommand3, "GameServer");
						int num3 = (int)dBToDataTable3.Rows[0]["得分统计"];
						if (dBToDataTable3.Rows.Count >= 1 && players3.得分统计 != 0)
						{
							players3.Player_WuXun += World.科举奖励第一名奖武勋;
							players3.更新武勋效果();
							players3.保存人物的数据();
							players3.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖武勋.ToString() + "个武勋", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players3.UserName + "】，得分：" + num3.ToString() + "分", 10, "系统提示");
						}
					}
					players3.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
		}

		public void function4(object ojb)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			if (World.科举考试奖励类型 == 0)
			{
				try
				{
					Players players = ojb as Players;
					List<科举系统类4> list = new List<科举系统类4>();
					foreach (科举系统类4 value in World.科举出题4.Values)
					{
						list.Add(value);
					}
					for (int i = 0; i < list.Count; i++)
					{
						players.系统提示("第" + list[i].序号.ToString() + "题是：" + list[i].标题, 10, World.科举提示设置);
						players.系统提示(list[i].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list[i].正确答案 == players.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.保存人物的数据();
								players.保存人物数据存储过程();
								players.系统提示("恭喜你答对了。奖励你" + list[i].元宝.ToString() + " 个元宝。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players.得分统计 += list[i].元宝;
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.系统提示("恭喜你答对了。此题" + list[i].元宝.ToString() + "个元宝", 20, "系统提示");
								players.保存人物的数据();
								players.保存人物数据存储过程();
							}
						}
						else if (players.答案选择 == "0")
						{
							players.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players.系统提示("很遗憾，你答错了。本题正确答案是[" + list[i].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "GameServer");
						int num = (int)dBToDataTable.Rows[0]["得分统计"];
						if (dBToDataTable.Rows.Count >= 1 && players.得分统计 != 0)
						{
							players.检察元宝数据(World.科举奖励第一名奖元宝, 2);
							players.保存元宝数据();
							players.保存人物的数据();
							players.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖元宝.ToString() + "个元宝", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players.UserName + "】，得分：" + num.ToString() + "分", 10, "系统提示");
						}
					}
					players.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 1)
			{
				try
				{
					Players players2 = ojb as Players;
					List<科举系统类4> list2 = new List<科举系统类4>();
					foreach (科举系统类4 value2 in World.科举出题4.Values)
					{
						list2.Add(value2);
					}
					for (int j = 0; j < list2.Count; j++)
					{
						players2.系统提示("第" + list2[j].序号.ToString() + "题是：" + list2[j].标题, 10, World.科举提示设置);
						players2.系统提示(list2[j].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list2[j].正确答案 == players2.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
								players2.系统提示("恭喜你答对了。奖励你" + list2[j].积分.ToString() + " 个积分。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players2.得分统计 += list2[j].积分;
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.系统提示("恭喜你答对了。此题" + list2[j].积分.ToString() + "个积分", 20, "系统提示");
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
							}
						}
						else if (players2.答案选择 == "0")
						{
							players2.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players2.系统提示("很遗憾，你答错了。本题正确答案是[" + list2[j].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players2.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand2 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable2 = DBA.GetDBToDataTable(sqlCommand2, "GameServer");
						int num2 = (int)dBToDataTable2.Rows[0]["得分统计"];
						if (dBToDataTable2.Rows.Count >= 1 && players2.得分统计 != 0)
						{
							players2.检察积分数据(World.科举奖励第一名奖积分, 1);
							players2.保存积分数据();
							players2.保存人物的数据();
							players2.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖积分.ToString() + "个积分", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players2.UserName + "】，得分：" + num2.ToString() + "分", 10, "系统提示");
						}
					}
					players2.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 2)
			{
				try
				{
					Players players3 = ojb as Players;
					List<科举系统类4> list3 = new List<科举系统类4>();
					foreach (科举系统类4 value3 in World.科举出题4.Values)
					{
						list3.Add(value3);
					}
					for (int k = 0; k < list3.Count; k++)
					{
						players3.系统提示("第" + list3[k].序号.ToString() + "题是：" + list3[k].标题, 10, World.科举提示设置);
						players3.系统提示(list3[k].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list3[k].正确答案 == players3.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
								players3.系统提示("恭喜你答对了。奖励你" + list3[k].武勋.ToString() + " 个武勋。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players3.得分统计 += list3[k].武勋;
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.系统提示("恭喜你答对了。此题" + list3[k].武勋.ToString() + "个武勋", 20, "系统提示");
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
							}
						}
						else if (players3.答案选择 == "0")
						{
							players3.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players3.系统提示("很遗憾，你答错了。本题正确答案是[" + list3[k].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players3.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand3 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable3 = DBA.GetDBToDataTable(sqlCommand3, "GameServer");
						int num3 = (int)dBToDataTable3.Rows[0]["得分统计"];
						if (dBToDataTable3.Rows.Count >= 1 && players3.得分统计 != 0)
						{
							players3.Player_WuXun += World.科举奖励第一名奖武勋;
							players3.更新武勋效果();
							players3.保存人物的数据();
							players3.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖武勋.ToString() + "个武勋", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players3.UserName + "】，得分：" + num3.ToString() + "分", 10, "系统提示");
						}
					}
					players3.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
		}

		public void function5(object ojb)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			if (World.科举考试奖励类型 == 0)
			{
				try
				{
					Players players = ojb as Players;
					List<科举系统类5> list = new List<科举系统类5>();
					foreach (科举系统类5 value in World.科举出题5.Values)
					{
						list.Add(value);
					}
					for (int i = 0; i < list.Count; i++)
					{
						players.系统提示("第" + list[i].序号.ToString() + "题是：" + list[i].标题, 10, World.科举提示设置);
						players.系统提示(list[i].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list[i].正确答案 == players.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.保存人物的数据();
								players.保存人物数据存储过程();
								players.系统提示("恭喜你答对了。奖励你" + list[i].元宝.ToString() + " 个元宝。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players.得分统计 += list[i].元宝;
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.系统提示("恭喜你答对了。此题" + list[i].元宝.ToString() + "个元宝", 20, "系统提示");
								players.保存人物的数据();
								players.保存人物数据存储过程();
							}
						}
						else if (players.答案选择 == "0")
						{
							players.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players.系统提示("很遗憾，你答错了。本题正确答案是[" + list[i].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "GameServer");
						int num = (int)dBToDataTable.Rows[0]["得分统计"];
						if (dBToDataTable.Rows.Count >= 1 && players.得分统计 != 0)
						{
							players.检察元宝数据(World.科举奖励第一名奖元宝, 2);
							players.保存元宝数据();
							players.保存人物的数据();
							players.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖元宝.ToString() + "个元宝", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players.UserName + "】，得分：" + num.ToString() + "分", 10, "系统提示");
						}
					}
					players.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 1)
			{
				try
				{
					Players players2 = ojb as Players;
					List<科举系统类5> list2 = new List<科举系统类5>();
					foreach (科举系统类5 value2 in World.科举出题5.Values)
					{
						list2.Add(value2);
					}
					for (int j = 0; j < list2.Count; j++)
					{
						players2.系统提示("第" + list2[j].序号.ToString() + "题是：" + list2[j].标题, 10, World.科举提示设置);
						players2.系统提示(list2[j].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list2[j].正确答案 == players2.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
								players2.系统提示("恭喜你答对了。奖励你" + list2[j].积分.ToString() + " 个积分。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players2.得分统计 += list2[j].积分;
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.系统提示("恭喜你答对了。此题" + list2[j].积分.ToString() + "个积分", 20, "系统提示");
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
							}
						}
						else if (players2.答案选择 == "0")
						{
							players2.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players2.系统提示("很遗憾，你答错了。本题正确答案是[" + list2[j].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players2.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand2 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable2 = DBA.GetDBToDataTable(sqlCommand2, "GameServer");
						int num2 = (int)dBToDataTable2.Rows[0]["得分统计"];
						if (dBToDataTable2.Rows.Count >= 1 && players2.得分统计 != 0)
						{
							players2.检察积分数据(World.科举奖励第一名奖积分, 1);
							players2.保存积分数据();
							players2.保存人物的数据();
							players2.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖积分.ToString() + "个积分", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players2.UserName + "】，得分：" + num2.ToString() + "分", 10, "系统提示");
						}
					}
					players2.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 2)
			{
				try
				{
					Players players3 = ojb as Players;
					List<科举系统类5> list3 = new List<科举系统类5>();
					foreach (科举系统类5 value3 in World.科举出题5.Values)
					{
						list3.Add(value3);
					}
					for (int k = 0; k < list3.Count; k++)
					{
						players3.系统提示("第" + list3[k].序号.ToString() + "题是：" + list3[k].标题, 10, World.科举提示设置);
						players3.系统提示(list3[k].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list3[k].正确答案 == players3.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
								players3.系统提示("恭喜你答对了。奖励你" + list3[k].武勋.ToString() + " 个武勋。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players3.得分统计 += list3[k].武勋;
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.系统提示("恭喜你答对了。此题" + list3[k].武勋.ToString() + "个武勋", 20, "系统提示");
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
							}
						}
						else if (players3.答案选择 == "0")
						{
							players3.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players3.系统提示("很遗憾，你答错了。本题正确答案是[" + list3[k].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players3.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand3 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable3 = DBA.GetDBToDataTable(sqlCommand3, "GameServer");
						int num3 = (int)dBToDataTable3.Rows[0]["得分统计"];
						if (dBToDataTable3.Rows.Count >= 1 && players3.得分统计 != 0)
						{
							players3.Player_WuXun += World.科举奖励第一名奖武勋;
							players3.更新武勋效果();
							players3.保存人物的数据();
							players3.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖武勋.ToString() + "个武勋", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players3.UserName + "】，得分：" + num3.ToString() + "分", 10, "系统提示");
						}
					}
					players3.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
		}

		public void function6(object ojb)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			if (World.科举考试奖励类型 == 0)
			{
				try
				{
					Players players = ojb as Players;
					List<科举系统类6> list = new List<科举系统类6>();
					foreach (科举系统类6 value in World.科举出题6.Values)
					{
						list.Add(value);
					}
					for (int i = 0; i < list.Count; i++)
					{
						players.系统提示("第" + list[i].序号.ToString() + "题是：" + list[i].标题, 10, World.科举提示设置);
						players.系统提示(list[i].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list[i].正确答案 == players.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.保存人物的数据();
								players.保存人物数据存储过程();
								players.系统提示("恭喜你答对了。奖励你" + list[i].元宝.ToString() + " 个元宝。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players.得分统计 += list[i].元宝;
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.系统提示("恭喜你答对了。此题" + list[i].元宝.ToString() + "个元宝", 20, "系统提示");
								players.保存人物的数据();
								players.保存人物数据存储过程();
							}
						}
						else if (players.答案选择 == "0")
						{
							players.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players.系统提示("很遗憾，你答错了。本题正确答案是[" + list[i].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "GameServer");
						int num = (int)dBToDataTable.Rows[0]["得分统计"];
						if (dBToDataTable.Rows.Count >= 1 && players.得分统计 != 0)
						{
							players.检察元宝数据(World.科举奖励第一名奖元宝, 2);
							players.保存元宝数据();
							players.保存人物的数据();
							players.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖元宝.ToString() + "个元宝", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players.UserName + "】，得分：" + num.ToString() + "分", 10, "系统提示");
						}
					}
					players.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 1)
			{
				try
				{
					Players players2 = ojb as Players;
					List<科举系统类6> list2 = new List<科举系统类6>();
					foreach (科举系统类6 value2 in World.科举出题6.Values)
					{
						list2.Add(value2);
					}
					for (int j = 0; j < list2.Count; j++)
					{
						players2.系统提示("第" + list2[j].序号.ToString() + "题是：" + list2[j].标题, 10, World.科举提示设置);
						players2.系统提示(list2[j].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list2[j].正确答案 == players2.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
								players2.系统提示("恭喜你答对了。奖励你" + list2[j].积分.ToString() + " 个积分。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players2.得分统计 += list2[j].积分;
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.系统提示("恭喜你答对了。此题" + list2[j].积分.ToString() + "个积分", 20, "系统提示");
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
							}
						}
						else if (players2.答案选择 == "0")
						{
							players2.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players2.系统提示("很遗憾，你答错了。本题正确答案是[" + list2[j].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players2.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand2 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable2 = DBA.GetDBToDataTable(sqlCommand2, "GameServer");
						int num2 = (int)dBToDataTable2.Rows[0]["得分统计"];
						if (dBToDataTable2.Rows.Count >= 1 && players2.得分统计 != 0)
						{
							players2.检察积分数据(World.科举奖励第一名奖积分, 1);
							players2.保存积分数据();
							players2.保存人物的数据();
							players2.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖积分.ToString() + "个积分", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players2.UserName + "】，得分：" + num2.ToString() + "分", 10, "系统提示");
						}
					}
					players2.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 2)
			{
				try
				{
					Players players3 = ojb as Players;
					List<科举系统类6> list3 = new List<科举系统类6>();
					foreach (科举系统类6 value3 in World.科举出题6.Values)
					{
						list3.Add(value3);
					}
					for (int k = 0; k < list3.Count; k++)
					{
						players3.系统提示("第" + list3[k].序号.ToString() + "题是：" + list3[k].标题, 10, World.科举提示设置);
						players3.系统提示(list3[k].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list3[k].正确答案 == players3.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
								players3.系统提示("恭喜你答对了。奖励你" + list3[k].武勋.ToString() + " 个武勋。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players3.得分统计 += list3[k].武勋;
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.系统提示("恭喜你答对了。此题" + list3[k].武勋.ToString() + "个武勋", 20, "系统提示");
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
							}
						}
						else if (players3.答案选择 == "0")
						{
							players3.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players3.系统提示("很遗憾，你答错了。本题正确答案是[" + list3[k].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players3.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand3 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable3 = DBA.GetDBToDataTable(sqlCommand3, "GameServer");
						int num3 = (int)dBToDataTable3.Rows[0]["得分统计"];
						if (dBToDataTable3.Rows.Count >= 1 && players3.得分统计 != 0)
						{
							players3.Player_WuXun += World.科举奖励第一名奖武勋;
							players3.更新武勋效果();
							players3.保存人物的数据();
							players3.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖武勋.ToString() + "个武勋", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players3.UserName + "】，得分：" + num3.ToString() + "分", 10, "系统提示");
						}
					}
					players3.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
		}

		public void function7(object ojb)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			if (World.科举考试奖励类型 == 0)
			{
				try
				{
					Players players = ojb as Players;
					List<科举系统类7> list = new List<科举系统类7>();
					foreach (科举系统类7 value in World.科举出题7.Values)
					{
						list.Add(value);
					}
					for (int i = 0; i < list.Count; i++)
					{
						players.系统提示("第" + list[i].序号.ToString() + "题是：" + list[i].标题, 10, World.科举提示设置);
						players.系统提示(list[i].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list[i].正确答案 == players.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.保存人物的数据();
								players.保存人物数据存储过程();
								players.系统提示("恭喜你答对了。奖励你" + list[i].元宝.ToString() + " 个元宝。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players.得分统计 += list[i].元宝;
								players.检察元宝数据(list[i].元宝, 2);
								players.保存元宝数据();
								players.系统提示("恭喜你答对了。此题" + list[i].元宝.ToString() + "个元宝", 20, "系统提示");
								players.保存人物的数据();
								players.保存人物数据存储过程();
							}
						}
						else if (players.答案选择 == "0")
						{
							players.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players.系统提示("很遗憾，你答错了。本题正确答案是[" + list[i].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable = DBA.GetDBToDataTable(sqlCommand, "GameServer");
						int num = (int)dBToDataTable.Rows[0]["得分统计"];
						if (dBToDataTable.Rows.Count >= 1 && players.得分统计 != 0)
						{
							players.检察元宝数据(World.科举奖励第一名奖元宝, 2);
							players.保存元宝数据();
							players.保存人物的数据();
							players.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖元宝.ToString() + "个元宝", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players.UserName + "】，得分：" + num.ToString() + "分", 10, "系统提示");
						}
					}
					players.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 1)
			{
				try
				{
					Players players2 = ojb as Players;
					List<科举系统类7> list2 = new List<科举系统类7>();
					foreach (科举系统类7 value2 in World.科举出题7.Values)
					{
						list2.Add(value2);
					}
					for (int j = 0; j < list2.Count; j++)
					{
						players2.系统提示("第" + list2[j].序号.ToString() + "题是：" + list2[j].标题, 10, World.科举提示设置);
						players2.系统提示(list2[j].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list2[j].正确答案 == players2.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
								players2.系统提示("恭喜你答对了。奖励你" + list2[j].积分.ToString() + " 个积分。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players2.得分统计 += list2[j].积分;
								players2.检察积分数据(list2[j].积分, 1);
								players2.保存积分数据();
								players2.系统提示("恭喜你答对了。此题" + list2[j].积分.ToString() + "个积分", 20, "系统提示");
								players2.保存人物的数据();
								players2.保存人物数据存储过程();
							}
						}
						else if (players2.答案选择 == "0")
						{
							players2.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players2.系统提示("很遗憾，你答错了。本题正确答案是[" + list2[j].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players2.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand2 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable2 = DBA.GetDBToDataTable(sqlCommand2, "GameServer");
						int num2 = (int)dBToDataTable2.Rows[0]["得分统计"];
						if (dBToDataTable2.Rows.Count >= 1 && players2.得分统计 != 0)
						{
							players2.检察积分数据(World.科举奖励第一名奖积分, 1);
							players2.保存积分数据();
							players2.保存人物的数据();
							players2.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖积分.ToString() + "个积分", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players2.UserName + "】，得分：" + num2.ToString() + "分", 10, "系统提示");
						}
					}
					players2.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
			if (World.科举考试奖励类型 == 2)
			{
				try
				{
					Players players3 = ojb as Players;
					List<科举系统类7> list3 = new List<科举系统类7>();
					foreach (科举系统类7 value3 in World.科举出题7.Values)
					{
						list3.Add(value3);
					}
					for (int k = 0; k < list3.Count; k++)
					{
						players3.系统提示("第" + list3[k].序号.ToString() + "题是：" + list3[k].标题, 10, World.科举提示设置);
						players3.系统提示(list3[k].选择答案, 21, "选项");
						Thread.Sleep(World.科举答题回答时间);
						if (list3[k].正确答案 == players3.答案选择)
						{
							if (World.科举奖励类型 == 1)
							{
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
								players3.系统提示("恭喜你答对了。奖励你" + list3[k].武勋.ToString() + " 个武勋。", 23, "系统提示");
							}
							if (World.科举奖励类型 == 2)
							{
								players3.得分统计 += list3[k].武勋;
								players3.Player_WuXun += list3[k].武勋;
								players3.更新武勋效果();
								players3.系统提示("恭喜你答对了。此题" + list3[k].武勋.ToString() + "个武勋", 20, "系统提示");
								players3.保存人物的数据();
								players3.保存人物数据存储过程();
							}
						}
						else if (players3.答案选择 == "0")
						{
							players3.系统提示("此题你已放弃作答。", 20, "系统提示");
						}
						else
						{
							players3.系统提示("很遗憾，你答错了。本题正确答案是[" + list3[k].正确答案 + "]", 23, "系统提示");
						}
						Thread.Sleep(World.科举答题间隔时间);
						players3.答案选择 = "0";
					}
					if (World.科举奖励类型 == 2)
					{
						string sqlCommand3 = "Select TOP 1 * from [TBL_人物数据]  Order By 得分统计 Desc";
						DataTable dBToDataTable3 = DBA.GetDBToDataTable(sqlCommand3, "GameServer");
						int num3 = (int)dBToDataTable3.Rows[0]["得分统计"];
						if (dBToDataTable3.Rows.Count >= 1 && players3.得分统计 != 0)
						{
							players3.Player_WuXun += World.科举奖励第一名奖武勋;
							players3.更新武勋效果();
							players3.保存人物的数据();
							players3.系统提示("恭喜您，获得本届科举第一名。赏赐" + World.科举奖励第一名奖武勋.ToString() + "个武勋", 10, "告示");
							World.发送游戏特殊公告("本届科举第一名是【" + players3.UserName + "】，得分：" + num3.ToString() + "分", 10, "系统提示");
						}
					}
					players3.系统提示("本届科举结束。", 3, "告示");
					World.得分清零();
					DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
					World.科举.Dispose();
					Form1.WriteLine(3, "科举完了");
				}
				catch (Exception)
				{
				}
			}
		}

		private static void smethod_0()
		{
			list_0 = new List<int>();
		}

		public void 发送科举开始时间公告(object sender, ElapsedEventArgs e)
		{
			try
			{
				int num = (int)dateTime_0.Subtract(DateTime.Now).TotalSeconds;
				if (num != 0)
				{
					foreach (Players value in World.allConnectedChars.Values)
					{
						value.发送势力战开始倒计时(num);
						value.系统提示("科举考试还剩下 " + num.ToString() + " 秒，请做好准备，积极参与。答题命令如：!答题 A", 10, World.科举提示设置);
					}
				}
			}
			catch (Exception ex)
			{
				Form1.WriteLine(1, "科举 时间结束事件1 出错：" + ex?.ToString());
			}
		}

		public void 科举结束(object sender, ElapsedEventArgs e)
		{
			timer_2.Enabled = false;
			timer_2.Close();
			timer_2.Dispose();
			try
			{
				Random random = new Random();
				switch (random.Next(1, 7))
				{
				case 1:
				{
					ParameterizedThreadStart start7 = function;
					new Thread(start7);
					foreach (Players value in World.allConnectedChars.Values)
					{
						new Thread(start7).Start(value);
					}
					break;
				}
				case 2:
				{
					ParameterizedThreadStart start6 = function2;
					new Thread(start6);
					foreach (Players value2 in World.allConnectedChars.Values)
					{
						new Thread(start6).Start(value2);
					}
					break;
				}
				case 3:
				{
					ParameterizedThreadStart start5 = function3;
					new Thread(start5);
					foreach (Players value3 in World.allConnectedChars.Values)
					{
						new Thread(start5).Start(value3);
					}
					break;
				}
				case 4:
				{
					ParameterizedThreadStart start4 = function4;
					new Thread(start4);
					foreach (Players value4 in World.allConnectedChars.Values)
					{
						new Thread(start4).Start(value4);
					}
					break;
				}
				case 5:
				{
					ParameterizedThreadStart start3 = function5;
					new Thread(start3);
					foreach (Players value5 in World.allConnectedChars.Values)
					{
						new Thread(start3).Start(value5);
					}
					break;
				}
				case 6:
				{
					ParameterizedThreadStart start2 = function6;
					new Thread(start2);
					foreach (Players value6 in World.allConnectedChars.Values)
					{
						new Thread(start2).Start(value6);
					}
					break;
				}
				case 7:
				{
					ParameterizedThreadStart start = function7;
					new Thread(start);
					foreach (Players value7 in World.allConnectedChars.Values)
					{
						new Thread(start).Start(value7);
					}
					break;
				}
				}
			}
			catch (Exception)
			{
			}
		}

		public void 科举开始(object sender, ElapsedEventArgs e)
		{
			timer_0.Enabled = false;
			timer_0.Close();
			timer_0.Dispose();
			timer_1.Enabled = false;
			timer_1.Close();
			timer_1.Dispose();
			timer_2 = new System.Timers.Timer((double)int.Parse(string_0[3]) * 1000.0);
			timer_2.Elapsed += 科举结束;
			timer_2.Enabled = true;
			new Random(DateTime.Now.Millisecond);
			int.Parse(string_0[2]);
			int.Parse(string_0[3]);
			new List<MonSterClss>();
			World.得分清零();
			DBA.ExeSqlCommand("update TBL_人物数据 set 得分统计=0,答案选择='0' where (ID>=0)", "GameServer");
			try
			{
				foreach (Players value in World.allConnectedChars.Values)
				{
					value.系统提示(int.Parse(string_0[3]).ToString() + " 秒后，开始答题。", 10, World.科举提示设置);
				}
			}
			catch (Exception ex)
			{
				Form1.WriteLine(1, "科举 时间结束事件1 出错：" + ex?.ToString());
			}
		}
	}
}
